package kr.pe.johnkim.checkmileage.mobile.rest.service;

import kr.pe.johnkim.checkmileage.mobile.domain.CheckMileageMerchantMileage;
import kr.pe.johnkim.checkmileage.mobile.rest.dao.CheckMileageMerchantMileageDao;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

/**
 * Check Mileage 가맹점 메뉴/서비스 마일리지 관련 Service 기능들을 구현하는 클래스 이다.
 *
 * @author : johnkim <cale9797@gmail.com / Bettersoft, Inc.>
 * @Date : 12. 7. 25
 */
public class CheckMileageMerchantMileageServiceImpl implements CheckMileageMerchantMileageService {

    // SLF4J Logging
	private Logger logger = LoggerFactory.getLogger(CheckMileageMerchantMileageServiceImpl.class);

    @Autowired
    private CheckMileageMerchantMileageDao checkMileageMerchantMileageDao = null;

    /**
     * 메뉴/서비스 마일리지를 등록 한다.
     *
     * @param checkMileageMerchantMileage
     */
    @Override
    public void registerMerchantMileage(CheckMileageMerchantMileage checkMileageMerchantMileage) throws Exception {
        logger.info("registerMerchantMileage");

        checkMileageMerchantMileageDao.registerMerchantMileage(checkMileageMerchantMileage);
    }

    /**
     * 메뉴/서비스 마일리지 목록을 가져 온다.
     *
     * @param checkMileageMerchantMileage
     * @return
     */
    @Override
    public List<CheckMileageMerchantMileage> selectMerchantMileageList(CheckMileageMerchantMileage checkMileageMerchantMileage) {
        logger.info("selectMerchantMileageList");

        return checkMileageMerchantMileageDao.selectMerchantMileageList(checkMileageMerchantMileage);
    }

    /**
     * 메뉴/서비스 마일리지를 수정 한다.
     *
     * @param checkMileageMerchantMileage
     */
    @Override
    public void updateMerchantMileageInformation(CheckMileageMerchantMileage checkMileageMerchantMileage) throws Exception {
        logger.info("updateMerchantMileageInformation");

        checkMileageMerchantMileageDao.updateMerchantMileageInformation(checkMileageMerchantMileage);
    }

    /**
     * 메뉴/서비스 마일리지를 비활성화 한다.
     *
     * @param checkMileageMerchantMileage
     */
    @Override
    public void updateDeactivateMerchantMileage(CheckMileageMerchantMileage checkMileageMerchantMileage) throws Exception {
        logger.info("updateDeactivateMerchantMileage");

        checkMileageMerchantMileageDao.updateDeactivateMerchantMileage(checkMileageMerchantMileage);
    }
}
